{include file='public/header' /}

<body>

    <div class="layui-fluid">

        <div class="layui-row">

            <form class="layui-form " enctype="multipart/form-data" id="file" style="margin: 50px;">


            <div class="layui-form-item">
                   <fieldset class="layui-elem-field">

                     <legend>预约信息</legend>


                     <div class="layui-form-item" style="margin-top: 30px;">
                        <label class="layui-form-label" for="username">
                            微信昵称
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.userinfo.name}" disabled>
                          
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            服务项目
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.serviceinfo.name}" disabled>
                          
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            检测车型
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.brand}-{$info.model}" disabled>
                          
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            检测地址
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.province}-{$info.city}-{$info.county}" disabled>
                          
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            预约姓名
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.name}" disabled>
                          
                        </div>
                    </div>

                     <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            预约电话
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.phone}" disabled>
                          
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            检测时间
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.time}" disabled>
                          
                        </div>
                    </div>

                        
                   </fieldset>
            </div> 



              <div class="layui-form-item">
                   <fieldset class="layui-elem-field">

                     <legend>订单信息</legend>

                     <div class="layui-form-item" style="margin-top: 30px;">
                        <label class="layui-form-label" for="username">
                            订单编号
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.code}" disabled>
                          
                        </div>
                    </div>

                     <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            预约定金
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.deposit}" disabled>
                          
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            订单总金额
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.price}" disabled>
                          
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            生成时间
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.create_time}" disabled>
                          
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label" for="username">
                            支付状态
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                           {if $info.status == 1}
                           <span class="layui-btn layui-btn-danger layui-btn-xs" style="margin-top:8px;">待支付</span>
                           {elseif $info.status == 2}
                           <span class="layui-btn layui-btn-xs" style="margin-top:8px;">已支付</span>
                           {elseif $info.status == 3}
                           <span class="layui-btn layui-btn-warm layui-btn-xs" style="margin-top:8px;">检测中</span>
                           {elseif $info.status == 4}
                           <span class="layui-btn layui-btn-normal layui-btn-xs" style="margin-top:8px;">已完成</span>
                           {/if}
                          
                        </div>
                    </div>
                        
                   </fieldset>



                    <fieldset class="layui-elem-field">

                     <legend>员工信息</legend>

                     <div class="layui-form-item" style="margin-top: 30px;">
                        <label class="layui-form-label" for="username">
                            微信昵称
                        </label>

                        <div class="layui-input-block" style="width:62.5%;">
                            <input class="layui-input" type="text" value="{$info.staffinfo.name}" disabled>
                          
                        </div>
                    </div>
                   </fieldset>
            </div> 


      

            </form>
            
           

        </div>

    </div>

   


  <script type="text/javascript">
  
    function lookimg(a,path){

        layer.open({
          type: 1,
          skin: 'layui-layer-demo', //样式类名
          closeBtn: 1, //不显示关闭按钮
          anim: 2,
          area: ['80%', '80%'],
          shadeClose: true, //开启遮罩关闭
          content: "<img src='"+path+"' style='width:100%;'>"
        });

    }
</script>


<script>

  fileEle = document.getElementById('file');

  arr = [];

  //把value的值拿出来

  valEle = '';

  nulEle = '';


  $("#file").on("submit",function(){

    //阻止form默认提交

    var evt = event;

    evt.preventDefault();

    

    //得到formData

    var formData = new FormData($(this)[0]);


    // $("#submitBtn").attr("disabled","disabled");


    $.ajax({

      url:"{:url('Maintain/addgood')}",

      type:"post",

      async: false,

      cache: false,

      contentType: false,

      processData: false,

      data:formData,

      success:function(data){

        console.log(data);

        if (data == 1) {

          layer.msg('添加成功', {icon: 1,time: 1500});

          setTimeout(function(){
            //刷新父页面
            window.parent.location.reload(); 
            // 获得frame索引
            var index = parent.layer.getFrameIndex(window.name); 
            //关闭当前frame
            parent.layer.close(index);

          },1500);

        }else if(data == 2){

          layer.msg('添加失败,请完善全部信息！', {icon: 2,time: 1500});

        }else{

          layer.msg('添加失败', {icon: 2,time: 1500});


        }

        

      }

    })

  })

    </script>

</body>

